<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset={CHARSET}" http-equiv="Content-Type">
<meta content="IE=7" http-equiv="X-UA-Compatible">
<title>教教家教 - 专业家教信息平台</title>
<meta content="教教家教,专业家教信息平台" name="keywords">
<meta content="教教家教" name="description">
<link type="text/css" rel="stylesheet" href="{CSS_PATH}default.css" />
<script type="text/javascript" src="{JS_PATH}jquery.1.5.1.js"></script>
<script type="text/javascript" src="{JS_PATH}common.js"></script>
<script type="text/javascript">
$(function(){
	marquee('announ', 1, 700, 4000);
	$('#q').focus(function(){$(this).removeClass('focus');}).blur(function(){$(this).val() == '' ? $(this).addClass('focus') : '';});
});
</script>
</head>

<body>
<div class="header_top">
  <div class="top_content">
    <div class="announ" id="announ">
      <ul>
      <script type="text/javascript" src="?m=index&c=content&a=announ"></script>
      </ul>
    </div>
    <div class="login">
    {if $_SESSION['login']}
    你好，{$_SESSION['_username']}&nbsp;
    <a href="?m=index&c=content&a=e">我的家教</a><span>&nbsp;|&nbsp;</span>
    <a href="?m=member&c=index&a=logout">退出</a>
    {else}
    <a href="?m=member&c=index&a=login">登录</a><span>&nbsp;|&nbsp;</span>
    <a href="?m=member&c=index&a=register">注册</a>
    {/if}<span>&nbsp;|&nbsp;</span><a title="返回首页" href="{SITE_URL}">返回首页</a>
    </div>
    <div class="c"></div>
  </div>
</div>
<div class="header">
  <div class="logo"><a href="{SITE_URL}"><img src="{IMG_PATH}jiajiao/logo.png" /></a></div>
  <div class="search">
    <form name="searchform" id="searchform" method="get" action="">
    <input type="hidden" name="m" value="search" />
    <input type="hidden" name="c" value="index" />
    <input type="hidden" name="a" value="search" />
      <input type="text" id="q" name="q" {if isset($_GET['q'])}value="{$_GET['q']}"{/if} autocomplete="off" class="text{if !isset($_GET['q'])} focus{/if}"><input type="submit" class="button" value="搜 索">
    </form>
  </div>
  <div class="banner"><a href="?m=index&c=content&a=pub" class="pub">免费发布信息</a><a href="?m=index&c=content&a=e" class="edit">修改/删除信息</a></div>
<div class="diggbox" id="diggbox">
    <ul id="diggul"></ul>
  </div>
</div>

<style type="text/css">
.diggbox{position:absolute;border:1px solid #CCCCCC;background-color:#FFFFFF;box-shadow:2px 2px 2px 0px #CCCCCC;	width:349px;z-index:1;padding-bottom:5px;left:225px;top:33px;display:none;}
.diggbox ul li{display:block;padding:2px 5px;height: 24px;line-height: 24px;overflow: hidden;cursor:default;}
.diggbox ul li.selected{background-color:#E9F5FA;text-decoration:none;}
</style>
<script type="text/javascript">
var search_dely = 1;
$(function(){
	$('#q').keyup(function(e){var v = $(this).val();v = $.trim(v);var key = e.keyCode;
		if(key==13 && $('#diggbox').css('display')=='none' && v!=''){
			$('#searchform').submit();return;}
		if(!((key>=65 && key<=90) || (key>=48 && key<=57) || (key>=96 && key<=105) || key==32)){return;}
		if(search_dely == 0){return ;}
		if(v != ''){
			search_dely = 0;
			setTimeout("dely('" + v + "')", 100);}});
	$('#q').keydown(function(e){
		var key = e.keyCode;
		if($('#diggbox').css('display') != 'none'){  //键盘事件处理
			if(key == 13){
				if($('.selected').text() !== ''){
					$(this).val($('.selected').text())};
				$('#searchform').submit();return;}
			if(key == 40 || key == 39){
				var index = $('.selected').index('#diggul li');
				index++;if(index>= $('#diggul li').length){index = 0;}
				$('#diggul li').eq(index).addClass('selected').siblings().removeClass('selected');
			}
			if(key == 37 || key ==38){
				var index = $('.selected').index('#diggul li');
				index--;if(index <0){index = $('#diggul li').length - 1;}
				$('#diggul li').eq(index).addClass('selected').siblings().removeClass('selected');}}});
	$(':not("#q")').click(function(){$('#diggbox').hide();});
	$('#diggul li').live('click',function(){$('#q').val($(this).text());$('#searchform').submit();return;});
});
function dely(v){$.get('?m=search&c=index&a=kwd&_=' + v, function(data){
		if(data!=''){$('#diggul').html(data);
		$('#diggbox').css({display:'block'});
		$('#diggul li:first').addClass('selected');
		$('#diggul li').hover(function(){$(this).addClass('selected').siblings().removeClass('selected');});
		search_dely = 1;}});}
</script>